<template>
  <div class="container">
    <div class="title">用户协议</div>
    <div class="content">
      <div v-html="content"></div>
    </div>
  </div>
</template>

<script>
import { getConfig } from '../../api/api'
export default {
  data() {
    return {
      content: '',
    };
  },
  methods: {
    getConfigInfo() {
      getConfig().then(res => {
        this.$toast.clear();
        this.content = res.data[0].xieyi
      });
    },
  },
  mounted() {
    if(this.$route.query.id == 0) {
      this.getConfigInfo()
    } else {
      this.content = JSON.parse(localStorage.getItem('config')).shuoming
    }
  }
};
</script>

<style lang="less" scoped>
div {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.container {
  background-color: #f1f1f1;
  min-height: 100vh;
  .title {
    width: 100%;
    height: 60px;
    color: #fff;
    text-align: center;
    line-height: 60px;
    font-size: 1.2em;
    background-color: #333333;
  }
  .content {
    width: 100%;
    height: calc(100vh - 60px);
    background-color: #f1f1f1;
    padding: 30px 4%;
  }
}
</style>